<template>
	<view class="bg-white" style="height: 100vh;">
		<cu-custom bgColor="bg-gradual-orange" :isBack="true" backFlag="navigate">
			<block slot="backText">返回</block>
			<block slot="content">采集设备详情</block>
		</cu-custom>


				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">设备编号:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.deviceId}}</text>
					</view>
				</view>

				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">设备名称:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.deviceName}}</text>
					</view>
				</view>

				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">创建时间:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.createTime}}</text>
					</view>
				</view>

				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">设备状态:</text>
					</view>
					<view class="action">
						<text v-if="annotation.deviceStatus=='1'" class="text-black title ">在线</text>
						<text v-if="annotation.deviceStatus=='2'" class="text-black title ">离线</text>
					</view>
				</view>

				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">解析协议:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.protocol}}</text>
					</view>
				</view>

				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">供电方式:</text>
					</view>
					<view class="action">
						<text v-if="annotation.powerType=='1'" class="text-black title ">交流电供电</text>
						<text v-if="annotation.powerType=='2'" class="text-black title ">太阳能板+蓄电池</text>
					</view>
				</view>

				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">升级或新增:</text>
					</view>
					<view class="action">
						<text v-if="annotation.upOrAdd=='1'" class="text-black title ">升级</text>
						<text v-if="annotation.upOrAdd=='2'" class="text-black title ">新增</text>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">位置:</text>
					</view>
					<view class="action">
						<textarea
							style="border:solid 1px #3c9cff; 
							border-radius:8px; 
							resize:none; 
							margin-left: 1rem;
							width: 200px; 
							height:70px;
							overflow:auto;
							font: 14px 正体;
							text-align: left;"
							placeholder-style="position: absolute;left:1.2rem;top:0.7rem" 
							placeholder="" 
							name="input" 
							disabled
							v-model="annotation.deviceAddress">
						</textarea>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">备注:</text>
					</view>
					<view class="action">
						<textarea
							style="border:solid 1px #3c9cff; 
							border-radius:8px; 
							resize:none; 
							margin-left: 1rem;
							width: 200px; 
							height:70px;
							overflow:auto;
							font: 14px 正体;
							text-align: left;"
							placeholder-style="position: absolute;left:1.2rem;top:0.7rem" 
							placeholder="" 
							name="input" 
							disabled
							v-model="annotation.remarks">
						</textarea>
					</view>
				</view>

				<view class="padding flex flex-direction">
					<button class="cu-btn bg-orange lg"  @click="showPic()">查看图片</button>
				</view>
	</view>
</template>

<script>

import appSelect from '@/components/my-componets/appSelect.vue'

export default {
	components:{
		appSelect
	 },
	data(){
		return{
			NavBarColor:this.NavBarColor,
			annotation:{
				id:"",
				titile:"",
				startTime:"",
				sender:"",
				msgContent:"",
				recordVideo:"",
				workPic:"",
			},
			goodNumber:null,
			flg:true,
			src:"",
			pic:"",
			deviceId:"",
			bx_type: [
				{value:'1',text:"生产发货",},
				{value:'2',text:"未安装"},
				{value:'3',text:"已安装"},
				{value:'4',text:"故障维修"},
				{value:'5',text:"拆回"},
			] ,
			testType:'',
		}
	},

	onLoad: function (option) {
	    const annItem = JSON.parse(decodeURIComponent(option.item));
		this.annotation = annItem
		this.src=this.annotation.reportVideo
		this.pic=this.annotation.picture
		this.deviceId=this.annotation.deviceId
		console.log('@@@@@@@@@@@@@@@@@@@',this.pic)
	},
	created(){
		console.log("created")
	},
	methods:{




		showVideo() {
			uni.navigateTo({
				url: '/pages/common/commonVideo?item='+this.src
			})
		},
		showPic() {
		    console.log(this.pic)
			uni.navigateTo({
				url: '/pages/common/commonPic?item='+this.pic
			})
	    }
	}
}
</script>

<style>

</style>
